<template>
  <input :type="type" :value="value" :placeholder="placeholder" @input="(e) => {$emit('update:value', e.target.value),$emit('input', e.target.value)}" @focus="focus" @keyup.enter.stop="onEnter"/>
</template>

<script>
export default {
  name: 'MagicInput',
  props: {
    type: {
      type: String,
      default: 'text',
    },
    placeholder: {
      type: String,
      default: '',
    },
    value: String,
    focus: {
      type: Function,
      default: () => {},
    },
    onEnter: {
      type: Function,
      default: () => {}
    }
  },
}
</script>
<style scoped>
input {
  outline: 0;
  height: 22px;
  line-height: 22px;
  border-radius: 0;
  outline: 0;
  border: 1px solid var(--input-border-color);
  padding-left: 5px;
  background: var(--input-background);
  color : var(--color)
}
input:focus {
  border-color: var(--input-border-foucs-color);
}
</style>